package com.rybbaby.tss.tasks.core.task;

import com.rybbaby.tss.tasks.core.annotation.TaskClass;
import com.rybbaby.tss.tasks.core.annotation.TaskMethod;
import com.rybbaby.tss.tasks.core.task.service.ITssMemberPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@TaskClass(remark = "考勤任务调度")
public class MemberPackageValidaityTask extends BaseTask {


	@Autowired
	private ITssMemberPackageService tssMemberPackageService;

	@TaskMethod(remark = "激活课时包有效期")
	public void updatePackageValidity() {
		log("开始定时刷新已激活的课时包有效期...");
		// TODO ...
		try {
			//修改已激活的课时包有效期
			Integer row = tssMemberPackageService.updatePackageValidity();
			if(row>0){
				log("定时刷新已激活的课时包有效期修改成功!");
			}else{
				log("定时刷新已激活的课时包有效期修改失败!");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
